package cn.itsource.util;

/**
 * Ajax请求返回的结果信息
 */
public class AjaxResult {
    //默认为true
    private Boolean success = true;
    //返回信息 成功
    private String msg = "操作成功";

    /*上传图片文件后返回文件名*/
    private String fileName;

    /*存放认证后的用户 和jsessionId */
    private Object objResult ;

    /**
     * 提供一个有参构造，如果success为false，则设置msg为操作失败
     *
     * @param success
     */
    public AjaxResult(Boolean success) {
        this.success = success;
        if (!success) {
            this.msg = "操作失败";
        }
    }

    public AjaxResult(String msg) {
        this.success = false;
        this.msg = "操作失败: " + msg;
    }


    public AjaxResult() {
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Object getObjResult() {
        return objResult;
    }

    public void setObjResult(Object objResult) {
        this.objResult = objResult;
    }
}
